package com.shuyun.hystrix.dynamic.spi;

import com.netflix.hystrix.strategy.properties.HystrixDynamicProperties;
import com.netflix.hystrix.strategy.properties.HystrixDynamicProperty;

/**
 * @description: 仿照 HystrixDynamicPropertiesArchaius 编码
 * @author: shuai.chen@shuyun.com
 * @date: 2023/1/17 2:53 PM
 */
public class DemoHystrixDynamicProperties implements HystrixDynamicProperties {
    @Override
    public HystrixDynamicProperty<String> getString(String name, String fallback) {
        return new CustomDynamicProperty.StringDynamicProperty(name, fallback);
    }

    @Override
    public HystrixDynamicProperty<Integer> getInteger(String name, Integer fallback) {
        return new CustomDynamicProperty.IntegerDynamicProperty(name, fallback);
    }

    @Override
    public HystrixDynamicProperty<Long> getLong(String name, Long fallback) {
        return new CustomDynamicProperty.LongDynamicProperty(name, fallback);
    }

    @Override
    public HystrixDynamicProperty<Boolean> getBoolean(String name, Boolean fallback) {
        return new CustomDynamicProperty.BooleanDynamicProperty(name, fallback);
    }
}
